// css
require("../scss/admin_login.scss");
require("./bower_modules/font-awesome/css/font-awesome.min.css");

// js
// require("expose?jQuery!./bower_modules/jquery/dist/jquery.min");
// var $ = jQuery;

import {Provider} from "react-redux"
import {LoginPanelContainer} from "./containers/admin/LoginPanelContainer.jsx";

import loginApp from './reducers/admin/admin_login_reducers'
import {createStoreWithMiddleware} from "./common/common.js"

let store = createStoreWithMiddleware(loginApp)

store.subscribe(() => {
    const {loginPanel} = store.getState()
    if(loginPanel.isAccountRight === 1 && loginPanel.isPwdRight === 1){
        location.href = "/admin_home/course"
    }
})

ReactDOM.render(
    <Provider store={store}>
        <div>
        <LoginPanelContainer />
        {/*<DevTools />*/}
        </div>
    </Provider>,
    document.getElementById("login_panel_root")
)
